package com.maiji.cloud.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.maiji.cloud.entities.login.WeightChangeLog;
@Mapper
public interface WeightChangeLogMapper extends BaseMapper<WeightChangeLog>{
	/**
	 * 根据userId获得当前体重
	 * @param uuId
	 * @return
	 */
	WeightChangeLog selectOneByUserId(@Param("userId")String userId);
	/**
	 * 获得当日的体重记录
	 * @param date
	 * @param uuId
	 * @return
	 */
	WeightChangeLog getWeightChangeLogByuserIdAndTime(@Param("date")Date date,@Param("userId") String userId);

	/**
	 * 获取最新一次记录
	 * @param date
	 * @param userId
	 * @return
	 */
	WeightChangeLog getNewWeightChangeLogByuserIdAndTime(@Param("date")Date date,@Param("userId") String userId);
	
	
	/**
	 * 修改
	 * @param weightChangeLog
	 */
	void updateByPrimaryKey(WeightChangeLog weightChangeLog); 
	/**
	 * 根据userId查询所有的体重记录
	 * @param userId
	 * @return
	 */
	List<WeightChangeLog> getWeightChangeLogListByUserId(@Param("userId")String userId);
}
